/*
 * =====================================================================================
 *
 *       Filename:  array.h
 *
 *    Description: common type array head file  
 *
 *        Version:  1.0
 *        Created:  07/20/2011 10:21:50 PM
 *       Revision:   
 *       Compiler:  gcc
 *
 *         Author:  Bran Zhang 
 *        Company:  Orange'S 
 *
 * =====================================================================================
 */

#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
//#include "CommonType.h"

#ifndef __ARRAY_H__
#define __ARRAY_H__

#define MAX_ARRAY_DIM 8
#define DEBUG 1

typedef struct Array_Node {
    void *base;
    int elem_size;
    int dimension;
    int *bounds;
    int *constants;
}Array;

int init_array(Array *pArray, int elem_size, int dim, ...);

void destroy_array(Array *pArray);

int get_value(Array *pArray, void *pElem, ...);

int assign_value(Array *pArray, void *pElem, ...);

int locate_elem(Array *pArray, va_list ap, int *pOff);

#endif
